package com.jprocms.module.cms.dal.mysql.tplinclude;

import com.jpro.framework.common.pojo.PageResult;
import com.jpro.framework.mybatis.core.mapper.BaseMapperX;
import com.jpro.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.jprocms.module.cms.controller.admin.tplinclude.vo.TplIncludePageReqVO;
import com.jprocms.module.cms.dal.dataobject.tplinclude.TplIncludeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 模板包含页面 Mapper
 *
 * @author jprocms
 */
@Mapper
public interface TplIncludeMapper extends BaseMapperX<TplIncludeDO> {

    default PageResult<TplIncludeDO> selectPage(TplIncludePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TplIncludeDO>()
                .eqIfPresent(TplIncludeDO::getTplPath, reqVO.getTplPath())
                .eqIfPresent(TplIncludeDO::getIncludePage, reqVO.getIncludePage())
                .eqIfPresent(TplIncludeDO::getUserId, reqVO.getUserId())
                .betweenIfPresent(TplIncludeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TplIncludeDO::getId));
    }

}